}
pub fn warn<T: fmt::Display>(&mut self, message: T) -> CargoResult<()> {
- self.err().say_status("warning:", message, YELLOW, false)
+ match self.verbosity {
+ Quiet => Ok(()),
+ _ => self.err().say_status("warning:", message, YELLOW, false),
+ }
}
pub fn set_verbosity(&mut self, verbose: bool, quiet: bool) -> CargoResult<()> {
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()),
execs().with_status(0));
});
+
+test!(q_silences_warnings {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+ authors = []
+ "#)
+ .file("src/main.rs", "fn main() {}");
+ p.build();
+
+ assert_that(cargo_process("install").arg("-q").arg("--path").arg(p.root()),
+ execs().with_status(0).with_stderr(""));
+});